<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>主页</title>
    <link rel="stylesheet" href="libs/layui/css/layui.css">
</head>
<body>
<div id="content"></div>
<script src="libs/jquery/jquery.min.js"></script>
<script src="libs/layui/layui.js"></script>
<script src="config.js"></script>
<script type="text/javascript">
    var conf = {};
    var d = {
        userInfo: {'userName': '杜神'},
        list: [
            {'createTime': '2017年12月9日', 'blogHead': '哈哈哈哈哈'},
            {'createTime': '2017年11月9日', 'blogHead': '呵呵呵呵呵'},
            {'createTime': '2017年10月9日', 'blogHead': '呼呼呼呼呼'}
        ]
    };
    layui.use(["layer", "laytpl"], function () {
        var layer = layui.layer, laytpl = layui.laytpl;
        $.ajax({
            type: 'GET',
            dataType: 'json',
            contentType: 'application/json;charset=UTF-8',
            url: '/biz/9810'
        })
            .then(function (result) {
                if (result.httpCode == 200) {
                    conf = result.data.tpl1;
                    //conf = model.innerHTML;
                    console.info(conf);
                    var getTpl = conf
                        , view = document.getElementById('content');
                    laytpl(getTpl).render(d, function (html) {
                        view.innerHTML = html;
                    });
                }
            });
    });
</script>
</body>
</html>